package cn.aws360.boot.extend.open.api.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author junnan
 */
@Getter
@AllArgsConstructor
public enum HotsApiEnum {

    /**
     * 微博
     */
    WEIBO("weibo", "https://api.vvhan.com/api/hotlist?type=wbHot"),

    /**
     * 百度
     */
    BAIDU("baidu", "https://api.vvhan.com/api/hotlist?type=baiduRD"),

    /**
     * 知乎
     */
    ZHIHU("zhihu", "https://api.vvhan.com/api/hotlist?type=zhihuHot"),

    /**
     * B站
     */
    BILI("bili", "https://api.vvhan.com/api/hotlist?type=bili"),

    /**
     * 36KE
     */
    KE36("36Ke", "https://api.vvhan.com/api/hotlist?type=36Ke"),

    /**
     * 抖音
     */
    DOUYIN("douyin", "https://api.vvhan.com/api/hotlist?type=douyinHot"),

    ;

    private final String key;
    private final String url;

    public static HotsApiEnum getEnum(String key) {
        for (HotsApiEnum apiEnum : values()) {
            if (apiEnum.getKey().equalsIgnoreCase(key)) {
                return apiEnum;
            }
        }
        return null;
    }

}
